////
//
/// \file ./include/inc/parser/immediate_number_node.hpp
//
//  Copyright 2007, 2008 Chandler Carruth
//
//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
//  use this file except in compliance with the License.  You may obtain a copy
//  of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
//  License for the specific language governing permissions and limitations
//  under the License.
//
////

#ifndef inc_parser_immediate_number_node_header
#define inc_parser_immediate_number_node_header

#include <string>

#include <boost/regex.hpp>
#include <gmpxx.h>
#include <mpfr.h>

#include <inc/parser/parse_tree_node.hpp>

namespace inc {
namespace parser {

/// \brief  Decimal immediate number parse node
/// \author Chandler Carruth
/// \date   2007.06.15
///
/// This provides a node representing an immediate number. It can parse any
/// common number format: binary, octal, decimal, and hexadecimal as well as
/// both integer only, fractional, and exponent forms.

class   ImmediateNumberNode : public ParseTreeNode
{
public:
  virtual bool parse( const iterator& first,
                      const iterator& last,
                      iterator& last_parsed );

private:
  /// Private integer to hold the value of this immediate.
  mpz_class int_value;

  /// Regular expression used in parsing.
  static const boost::regex imm_number_regex;
};

} //  end parser namespace
} //  end inc namespace
#endif  //  inc_parser_immediate_number_node_header
